package com.mall.shopping.converter;

import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.CartProductDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface CartProductConverter {
    @Mappings({
            @Mapping(source = "id",target = "productId"),
            @Mapping(source = "price",target = "salePrice"),
            @Mapping(source = "title",target = "productName")
    })
    CartProductDto item2Dto(Item item);
}
